﻿//-----------------------------------------------------------------------
// <copyright file="ProblemDefinition.cs" company="Numbrella foundation">
// Copyright (c) Numbrella foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Numbrella.Interaction
{
    using System;
    using System.Runtime.Serialization;

    /// <summary>
    /// Contains all informatin about Numbrella problem.
    /// </summary>
    [DataContract]
    public class ProblemDefinition
    {
        #region Initialization

        /// <summary>
        /// Initializes a new instance of the <see cref="ProblemDefinition"/> class.
        /// </summary>
        /// <param name="name">Unique problem name.</param>
        /// <param name="description">Problem description.</param>
        /// <param name="implementation">Problem implementation details.</param>
        /// <param name="credentials">Problem credentials.</param>
        public ProblemDefinition(
            string name, ProblemDescription description, ProblemImplementation implementation, ProblemCredentials credentials)
        {
            if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name");
            if (description == null) throw new ArgumentNullException("description");
            if (implementation == null) throw new ArgumentNullException("implementation");
            if (credentials == null) throw new ArgumentNullException("credentials");

            this.Name = name;
            this.Description = description;
            this.Implementation = implementation;
            this.Credentials = credentials;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets problem name.
        /// </summary>
        [DataMember]
        public string Name { get; private set; }

        /// <summary>
        /// Gets problem description.
        /// </summary>
        [DataMember]
        public ProblemDescription Description { get; private set; }

        /// <summary>
        /// Gets problem implementation aspects.
        /// </summary>
        [DataMember]
        public ProblemImplementation Implementation { get; private set; }

        /// <summary>
        /// Gets problem credentials.
        /// </summary>
        [DataMember]
        public ProblemCredentials Credentials { get; private set; }

        #endregion
    }
}
